package com.huaxin.device.dto.enums.validator;

import com.huaxin.device.dto.enums.PhaseCount;
import com.huaxin.device.dto.enums.validation.ValidPhaseCount;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class PhaseCountValidator implements ConstraintValidator<ValidPhaseCount, Integer> {
    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext context) {
        if (value == null) {
            return true;
        }
        return PhaseCount.isValid(value);
    }
}